package org.example.compare.dto;

import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;

import java.sql.Time;

public class WorkTimeDto {
    public Time mWorkStartTime;//开始时间
    public Time mWorkEndTime;//结束时间
    public long miTimeDiffS;//总时间单位秒 mWorkStartTime.secsTo(mWorkEndTime)
    public float mfTimeDiffH;//总时间单位小时 mWorkStartTime.secsTo(mWorkEndTime)/3600

    public void update(Time rWorkStartTime, Time rWorkEndTime) {
        mWorkStartTime = rWorkStartTime;
        mWorkEndTime = rWorkEndTime;
        miTimeDiffS = DateUtil.between(rWorkStartTime, rWorkEndTime, DateUnit.SECOND);
        mfTimeDiffH = (float)miTimeDiffS / 3600;
    }
}
